Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Add prose for exiting a CAUGHTadm block. #227

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

ioannad
Copy link
Collaborator

@ioannad ioannad commented Sep 7, 2022

Also slightly changed notation to match the formal overview document.

Comment on lines +3047 to +3055
1. Let :math:`\val^\ast` be the values on the top of the stack.

2. Pop the values :math:`\val^\ast` from the stack.

3. Assert: due to :ref:`validation <valid-instr-seq>`, an administrative instruction :math:`\CAUGHTadm\{a~\val_0^\ast\}` is now on the top of the stack.

4. Pop the |CAUGHTadm| from the stack.

5. Push :math:`\val^\ast` back to the stack.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other similar sections ('Exiting an exception handler' and 'Exiting instr with label L') use val^m. Is there any reason we use val^* here? For example, our 'Exiting an exception handler' section's prose is:

Exiting an exception handler                                                     
............................                                                     

When the end of a :ref:`try <syntax-try>` instruction is reached without a jump, exception, or trap, then the following steps are performed.

1. Let :math:`m` be the number of values on the top of the stack.

2. Pop the values :math:`\val^m` from the stack.

3. Assert: due to :ref:`validation <valid-instr-seq>`, the handler :math:`H` is now on the top of the stack.

4. Pop the handler from the stack.

5. Push :math:`\val^m` back to the stack.

6. Jump to the position after the |END| of the administrative instruction associated with the handler :math:`H`.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aheejin "Exiting instr with label L" uses val^m because it's relevant to the rule, in that labels are of the form label_m. Since caught does not have such a subscript, I used *, and I think it should be the same for "Exiting an exception handler".
So I would be more inclined to change to val^* in "Exiting an exception handler" and leaving this val* here as it is, but I would go with whatever you prefer. WDYT?

Copy link
Member

@aheejin aheejin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I see, thanks for the explanation!

@ioannad ioannad merged commit c5a8a43 into WebAssembly:main Sep 16, 2022
@@ -3039,17 +3039,32 @@ Throwing an exception with :ref:`tag address <syntax-tagaddr>` :math:`a`

.. _exec-caughtadm:

Holding a caught exception with |CAUGHTadm|
...........................................
Exiting a |CAUGHTadm|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Exiting a |CAUGHTadm|
Exiting a catch clause |CAUGHTadm|

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made PR #240 with this and the other changes requested.

Exiting a |CAUGHTadm|
.....................

When the |END| of a |CAUGHTadm|, is reached without a jump, exception, or trap, then the following steps are performed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When the |END| of a |CAUGHTadm|, is reached without a jump, exception, or trap, then the following steps are performed.
When the |END| of a catch clause |CAUGHTadm| is reached without a jump, exception, or trap, then the following steps are performed.


3. Assert: due to :ref:`validation <valid-instr-seq>`, an administrative instruction :math:`\CAUGHTadm\{a~\val_0^\ast\}` is now on the top of the stack.

4. Pop the |CAUGHTadm| from the stack.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. Pop the |CAUGHTadm| from the stack.
4. Pop the catch clause |CAUGHTadm| from the stack.

ioannad added a commit to ioannad/exception-handling that referenced this pull request Oct 21, 2022
that were made after that PR was merged.
In particular the following three comments are addressed.

- WebAssembly#227 (comment)
- WebAssembly#227 (comment)
- WebAssembly#227 (comment)
ioannad added a commit that referenced this pull request Nov 23, 2022
In particular the following three comments are addressed.

- #227 (comment)
- #227 (comment)
- #227 (comment)
- rephrasing "|CAUGHTadm| instruction" to "catch clause".
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants